//
// Created by james on 2021/11/2.
//

#ifndef JETPACKFRAMEWORK_JAVACALLHELPER_H
#define JETPACKFRAMEWORK_JAVACALLHELPER_H
#include <jni.h>

#define THREAD_MAIN 1
#define THREAD_CHILD 2

//未找到相应解码器
#define FFMPEG_FIND_DECODER_FAIL 100
//解码器初始化失败
#define FFMPEG_CODEC_CONTEXT_PARAMETERS_FAIL 101
#define FFMPEG_OPEN_DECODER_FAIL 102

class JavaCallHelper {

public:
    JavaVM *pVm;
    JNIEnv *pEnv;
    jobject jobj;

    jmethodID onParpare;
    jmethodID onError;
    jmethodID onProgress;

    JavaCallHelper(JavaVM *pVm, JNIEnv *pEnv, jobject &jobj);
    void onPerpare(int thread =THREAD_MAIN);
    void _onError(int errorCode,int thread =THREAD_MAIN);
};


#endif //JETPACKFRAMEWORK_JAVACALLHELPER_H
